# 异常的嵌套使用
# try:
#     num01=int(input(("请输入一个数字")))
#     try:
#         result=20/num01
#         pass
#     except Exception as msg:
#         print("异常，坟墓为0")
#         print(msg)
#         pass
#     else:
#         print(result)
#         pass
# except Exception as msg:
#     print("输入的类型不对")
#     print(msg)
#     pass

# 异常传递：
# 如果多个函数嵌套调用，内层函数异常，异常会往外部传递，直到异常被抛出，或被处理。
def a():
    print(1/0)
    pass
def b():
    a()
    pass
def c():
    try:
        b()
        pass
    except Exception as msg:
        print(msg)
        pass
    pass
c()
